/*
	File:				Player.h
	Course:		SGP 1208
	Author:		Kori Po
	Purpose:	Player object class
*/

#pragma once

#include "../SGD Wrappers/CSGD_DirectInput.h"
#include "../SGD Wrappers/CSGD_XAudio2.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"
#include "../SGD Wrappers/SGD_Math.h"

#include "Entity.h"
#include "Item.h"
#include "Ability.h"

#include "AnimationManager.h"

#include "MessageSystem.h"
#include "IListener.h"

#define HP_REGEN_RATE 2
#define MP_REGEN_RATE 10


class CPlayer : public CEntity, public IListener
{
private:
	//							Class DMS				Defualt values
	CAbility*			m_pAbilityA;		// NULL
	CAbility*			m_pAbilityB;			// NULL
	int						m_nHP;					// 100
	int						m_nMP;					// 100
	int						m_nHPRegen;		// 0
	int						m_nMPRegen;	// 10
	int						m_nDefense;		// 0
	int						m_nAtkPower;	// 20
	float					m_fAtkSpeed;		// 1.00
	int						m_nAP;					// 0
	float					m_fCDR;				// 0
	float					m_fMovement;  // 100
	CEntity*				m_pMyItem;

	int						m_nMaxHP;					// 100
	int						m_nMaxMP;					// 100


	// Wrapper Pointers
	CSGD_DirectInput*					m_InputGuy;
	CSGD_TextureManager*		m_TextureGuy;
	CSGD_XAudio2*							m_AudioGuy;


	CMessageSystem*						m_Messenger;

	virtual void HandleEvent( CEvent* pEvent );

	int m_nAtttackSFXID;

public:
	// Def Con && Decon
	CPlayer(void);
	virtual ~CPlayer(void);

	// Primary Running Functions
	void Update(float pElapsedTime);
	void Render(void);

	// Secondary Running Functions
	void Input(void);
	
	// Accessors
	CAbility*	GetAbilityA			( void ) const	{	return m_pAbilityA;		}
	CAbility*	GetAbilityB			( void ) const	{	return m_pAbilityB;		}
	int				GetHP					( void ) const	{	return m_nHP;					}
	int				GetMP					( void ) const	{	return m_nMP;				}
	int				GetHPRegen		( void ) const	{	return m_nHPRegen;		}
	int				GetMPRegen		( void ) const	{	return m_nMPRegen;	}
	int				GetMaxHP			( void ) const	{	return m_nMaxHP;			}
	int				GetMaxMP			( void ) const	{	return m_nMaxMP;		}
	int				GetDefense			( void ) const	{	return m_nDefense;		}
	int				GetAtkPower		( void ) const	{	return m_nAtkPower;	}
	float			GetAtkSpeed		( void ) const	{	return m_fAtkSpeed;	}
	int				GetAP					( void ) const	{	return m_nAP;					}
	float			GetCDR				( void ) const	{	return m_fCDR;				}
	float			GetMovement	( void ) const	{	return m_fMovement;	}
	CEntity*		GetMyItem			( void ) const	{	return m_pMyItem;		}

	// Mutator
	void			SetAbilityA				( CAbility*		pAbility				)		{	m_pAbilityA			=	pAbility	;			}
	void			SetAbilityB				( CAbility*		pAbility				)		{	m_pAbilityB			=	pAbility;				}
	void			SetHP							( int					pHP						)		{	m_nHP					=	pHP	;					}
	void			SetMP						( int					pMP					)		{	m_nMP					=	pMP;					}
	void			SetHPRegen			( int					pHPRegen		)		{	m_nHPRegen		=	pHPRegen;		}
	void			SetMPRegen			( int					pMPRegen		)		{	m_nMPRegen		=	pMPRegen;		}
	void			SetMaxHP					( int					pMaxHP			)		{	m_nHP					=	pMaxHP;			}
	void			SetMaxMP				( int					pMaxMP			)		{	m_nMP					=	pMaxMP;			}
	void			SetDefense				( int					pDefense			)		{	m_nDefense		=	pDefense;			}
	void			SetAtkPower			( int					pAtkPower		)		{	m_nAtkPower		=	pAtkPower;		}
	void			SetAtkSpeed			( float				pAtkSpeed		)		{	m_fAtkSpeed		=	pAtkSpeed;		}
	void			SetAP							( int					pAP					)		{	m_nAP					=	pAP;					}
	void			SetCDR						( float				pCDR					)		{	m_fCDR					=	pCDR;				}
	void			SetMovement		( float				pMovement	)		{	m_fMovement	=	pMovement;	}
	void			SetMyItem				( CEntity*		pItem				)		{	m_pMyItem			=	pItem;				}

	// Testing bool
	bool					m_bUBlu;
};

